1. Technical Field
The present application relates to computer operating systems, and more specifically, to inter-process communications in multi-process and/or multi-threaded
2. Related Art
Inter-process communication (IPC), which generally refers the exchange of data between programs either within the same computer or over a network, has become vital in today's real time distributed operations systems. IPC may be implemented using various data transfer methodologies, and is typically provided by the kernel module of the operating system. The kernel, which provides various user level computer programs with secure access to the computer's hardware, may provide IPC to allow coordination of processing among various processes and threads running on the system. As known in the art, a thread is a conveniently sized collection of programming steps that are scheduled and executed as a group, while a process may act as a “container” of threads. Processes may define the address space within which threads will execute. A process may contain at least one thread.
Message passing may be implemented to provide IPC throughout the entire system. In general, a message may be a packet of bytes passed from one process to another with no special meaning attached to the content of the message. The data in a message may have meaning for the sender of the message and for its receiver, but for no one else. Message passing not only allows processes to pass data to each other, but also provides a means of synchronizing the execution of several processes. As they send, receive, and reply to messages, processes undergo various “changes of state” that affect when and for how long, they may run. Knowing their states and priorities, the operating system may schedule processes as efficiently as possible to optimize the available processor resources.
To manage these changes of state and avoid deadlock situations that may occur due to communications taking place in the wrong state, operating systems employ synchronous message passing systems. Synchronous message passing systems are those that require coordination among the sending, receiving, and replying to of messages between the threads or processes. While these synchronous systems are ideal for enforcing in-order processing of messages, they are prone to out of state and deadlock conditions, and do not provide for high level of data throughput as messages must be sent individually. Moreover, these problems become exacerbated as the number of intercommunication processes or threads increase, limiting their effectiveness in today's data intensive processing.
To accommodate these processing needs, asynchronous systems have been developed to transfer messages independently of the coordination between communicating threads or processes. While these systems do provide great benefits, they still suffer from various performance issues. For example, some asynchronous message passing systems do not provide for full memory protected data transfers. As a result, programs may corrupt the address space of one another. Additionally, asynchronous message passing systems typically allow messages to be only buffered or sent at any point in time, blocking the thread from queuing new messages if previously queued messages are being transferred.
Accordingly, there is a need for an asynchronous message passing system that may provide mechanisms for sending multiple messages by message buffering, sending and/or receiving a batch of messages based on a triggering method. The system may also provide for fill memory protection when passing messages between the threads or processes, and may also provide a lockless queuing mechanism that allows for sending and buffering messages simultaneously.